import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    firstLotteryData:null,//初录阶梯数据
    firstCouponData:null,//初录奖项列表数据


    secLotteryData:null,//复录阶梯数据
    secCouponData:null,//复录奖项列表数据

    currentLottery:null,//当前阶梯号
    preLottery:null,//前阶梯号
    firstLotteryId:null,//
    secLotteryId:null,//
    preLotterySort:1,//切换前阶梯的排序
  },
  mutations: {
    setFirstLotteryData(state,val){
      state.firstLotteryData = val
    },
    setSecLotteryData(state,val){
      state.secLotteryData = val
    },

    
    setFirstCouponData(state,val){
      state.firstCouponData = val
    },
    setSecCouponData(state,val){
      state.secCouponData = val
    },

    setCurrentLottery(state,val){
      state.currentLottery = val
    },
    setPreLottery(state,val){
      state.preLottery = val
    },
    setPreLotterySort(state,val){
      state.preLotterySort = val
    },
  },
  actions: {

  },
  getters:{
    getFirstLotteryData(state){
      return state.firstLotteryData
    },
    getSecLotteryData(state){
      return state.secLotteryData
    },
    
    getFirstCouponData(state){
      return state.firstCouponData
    },
    getSecCouponData(state){
      return state.secCouponData
    },

    getCurrentLottery(state){
      return state.currentLottery
    },
    getPreLottery(state){
      return state.preLottery
    },
    getPreLotterySort(state){
      return state.preLotterySort
    },
  }
})
